public class Test031 {
    public static void main1(Deomr deomr){
        deomr.Deru();//收到赋值deocr时，调用deocr.Deru()。
    }
    public static void main(String[] args) {
        Deocr deocr = new Deocr();
        Comer comer = new Comer();
        main1(deocr);//给main1方法赋值
        main1(comer);
        main1(new Deomr());//简写
    }

    static class Deomr {
        public void Deru() {
            System.out.println("△");
        }
    }

    static class Deocr extends Deomr {
        @Override
        public void Deru() {
            System.out.println("❀");
        }
    }

    static class Comer extends Deomr {
        @Override
        public void Deru() {
            System.out.println("☆");
        }
    }
}